﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;

namespace RubricaSentimentale.Model
{
    [DataContract]
    public class MyString:Notificable
    {
        public string value;
        [DataMember]
        public string Value {
            get { return value; }
            set {
                notify("Value");
                this.value = value;
            }
        }

        public MyString(string s)
        {
            Value=s;
        }

        public static implicit operator MyString(string t)
        {
            return new MyString(t);
        }

        public static bool operator ==(MyString ms, string s)
        {
            return ms.Value==s;
        }

        public static bool operator !=(MyString ms, string s)
        {
            return !(ms.Value == s);
        }

        public static bool operator ==(MyString ms, MyString s)
        {
            return ms.Value == s.Value;
        }

        public static bool operator !=(MyString ms, MyString s)
        {
            return !(ms.Value == s.Value);
        }

        public static explicit operator string(MyString s)
        {
            return s.Value;
        }

        public override string ToString()
        {
            return Value;
        }
    }
}
